#include "logger.hpp"

void sync_example()
{
    auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
    console_sink->set_level(spdlog::level::debug);
    console_sink->set_pattern("[multi_sink_example] [%^%l%$] %v");
    auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("logs/mutisinks.txt", true);
    file_sink->set_level(spdlog::level::trace);
    
    spdlog::logger logger("multi_sink", {console_sink, file_sink});
    logger.set_level(spdlog::level::debug);
    logger.set_pattern("%Y-%m-%d %H:%M:%S [%l] %v");
    logger.debug("this should appear in both console and file");
    logger.info("this message should not appear in the console, only in the file");
}

int main()
{
    //sync_example();
    XKL::initLogger("file_logger", "logs/mutisinks.txt", spdlog::level::level_enum::debug);
    LOG_DEBUG("hello, {}", 111);
    LOG_TRACE("hello, {}", 111);
    LOG_INFO("hello, {}", 111);
    LOG_ERROR("hello, {}", 111);
    LOG_FATAL("hello, {}", 111);
    return 0;
}